Skip to content

chore(deps-dev): bump vitest, @vitest/ui and @vitest/coverage-v8 to 5.0.3 - #280

Merged
therealsama merged 1 commit into
mainfrom
deps/vitest-5
Oct 3, 2026
Merged

therealsama merged 1 commit into
mainfrom
deps/vitest-5

Conversation

@therealsama

Copy link
Copy Markdown
Collaborator

Summary

Upgrades vitest, @vitest/ui and @vitest/coverage-v8 from 4.x to 5.0.3 together. This replaces the three Dependabot PRs, which could never pass CI on their own. There is no user-visible impact: only dev dependencies and tests change.

  • Why the Dependabot PRs failed: @vitest/ui and @vitest/coverage-v8 require the exact same vitest version, so a PR that bumps only one of the three makes npm ci fail with ERESOLVE before any tests run.
  • Dependabot config: a new vitest group in .github/dependabot.yml keeps vitest and @vitest/* in one PR for all update types, majors included. @vitest/eslint-plugin is versioned on its own and accepts any vitest, so it is excluded. The group is listed first because Dependabot puts a dependency in the first group it matches.
  • Test fix: Vitest 5's fake timers record a requestIdleCallback scheduled with a timeout as a "Timeout", so their own cancelIdleCallback() throws Cannot clear timer: timer created with setTimeout() but cleared with cancelIdleCallback(). usePrefetchItem schedules with { timeout: 2000 }, which broke 22 tests in src/hooks/usePrefetchItem.test.ts. That file now leaves the idle-callback API unfaked and backs it with the faked setTimeout/clearTimeout. The hook itself is unchanged. The bug is still present in @sinonjs/fake-timers 15.4.0 and on its main branch.

Related issues

Supersedes #269, #270 and #271.

Commands run locally

  • npm run typecheck
  • npm run lint
  • npm run test:coverage (full unit suite plus the v8 coverage provider)
  • npm run build

I did not run the Playwright end-to-end tests locally because they don't use vitest; CI runs them.

Checklist

  • Changes are focused and avoid unrelated refactors
  • Tests were added or updated when behavior changed
  • Accessibility and mobile behavior were considered (not affected)

….0.3

@vitest/ui and @vitest/coverage-v8 peer-depend on the exact vitest
version, so Dependabot's one-package-per-PR major bumps (#269, #270,
#271) each failed `npm ci` with ERESOLVE before any test ran. They move
together here, and a `vitest` Dependabot group keeps them together from
now on, majors included. @vitest/eslint-plugin is versioned on its own
and accepts any vitest, so it stays out of the group.

Vitest 5's fake timers record a requestIdleCallback scheduled with a
`timeout` as a "Timeout", so their own cancelIdleCallback() throws a
type mismatch. usePrefetchItem schedules with `{ timeout: 2000 }`, which
failed 22 of its tests. That file now leaves the idle-callback API
unfaked and backs it with the faked setTimeout/clearTimeout; the hook
itself is unchanged.
@therealsama
therealsama merged commit b0ee73c into main Oct 3, 2026
4 checks passed
@therealsama
therealsama deleted the deps/vitest-5 branch October 3, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants